#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMessageBox>
#include <QFile>
#include <QTimer>
#include <QTimerEvent>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include "aes_tcp/aes_tcp.h"
#include "lus_core/lus_prase.h"


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void timerEvent(QTimerEvent *event);

    aes_tcp *my_tcp = new aes_tcp;
    lus_prase *my_lus = new lus_prase;
    QSerialPort *wireless_port;
    QSerialPort *gps_port;

    void serial_init(QSerialPort * port, QString name);
    QByteArray data;
    QString data2;
    QByteArray data3;
    QByteArray data4;

    QString gps_data;
    QRegExp reg;


    QTimer *timer;

private:
    Ui::MainWindow *ui;

private slots:
    void read_tcp_msg(QByteArray);//receive message
    void send_urt_msg();

    // lus send msg slot fun
    void send_lus_cmd(QByteArray cmd);

signals:
    void read_msg(QByteArray);

};

#endif // MAINWINDOW_H
